package com.simon.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.simon.vo.Login;

public class LoginController extends SimpleFormController {
	public LoginController() {
		setCommandClass(Login.class);
	}

	@Override
	protected ModelAndView onSubmit(HttpServletRequest request,
			HttpServletResponse response, Object command, BindException errors)
			throws Exception {
		Login login = (Login) command;
		System.out.println(login);
		return new ModelAndView("loginSuccess", "loginForm", login);
	}
}
